/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    overflow: hidden;
    user-select: none;
}

/* Main game container with responsive height */
.game-container {
    width: 100%;
    height: 100vh; /* Default for standalone */
    max-height: 450px; /* Limit for iframe */
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    position: relative;
    overflow: hidden;
}

/* Responsive height adjustment */
@media (max-height: 500px) {
    .game-container {
        height: 450px;
    }
}

/* Game header with stats */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: bold;
    color: #2d3436;
    cursor: help;
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: scale(1.05);
}

.icon {
    font-size: 18px;
}

/* Happiness meter */
.happiness-meter {
    width: 60px;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.happiness-fill {
    height: 100%;
    background: linear-gradient(90deg, #00b894, #00cec9);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 100%;
}

/* Timer styling */
.timer-container {
    background: #e17055;
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Main café scene */
.cafe-scene {
    flex: 1;
    display: flex;
    position: relative;
    background: linear-gradient(180deg, #81ecec, #74b9ff);
    overflow: hidden;
}

/* Kitchen area */
.kitchen-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    border-radius: 0 20px 0 0;
}

/* Chef character */
.chef-character {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.chef-character:hover {
    transform: scale(1.1);
}

.chef-face {
    font-size: 48px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.chef-status {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Situation alerts */
.situation-alert {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff7675;
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(255, 118, 117, 0.4);
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.5s ease;
    z-index: 5;
}

.situation-alert.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.alert-icon {
    font-size: 24px;
    text-align: center;
    margin-bottom: 5px;
}

.alert-text {
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

/* Customer area */
.customer-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    border-radius: 20px 0 0 0;
}

.customer {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.customer:hover {
    transform: scale(1.1);
}

.customer-face {
    font-size: 40px;
    margin-bottom: 10px;
}

.customer-thought {
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    color: #2d3436;
    max-width: 100px;
}

/* Action buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.hygiene-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
    min-height: 44px; /* Touch-friendly size */
}

.hygiene-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

.hygiene-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 184, 148, 0.3);
}

.hygiene-btn.correct {
    background: linear-gradient(135deg, #00b894, #55a3ff);
    animation: correctPulse 0.6s ease;
}

.hygiene-btn.incorrect {
    background: linear-gradient(135deg, #e17055, #d63031);
    animation: shake 0.6s ease;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.btn-icon {
    font-size: 18px;
}

.btn-text {
    flex: 1;
    text-align: left;
    line-height: 1.2;
}

/* Progress section */
.progress-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.achievement-badges {
    display: flex;
    gap: 5px;
}

.badge {
    font-size: 20px;
    animation: badgeAppear 0.5s ease;
}

@keyframes badgeAppear {
    0% { transform: scale(0) rotate(180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.daily-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.progress-label {
    font-weight: bold;
    color: #2d3436;
}

.progress-bar {
    width: 80px;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00b894, #00cec9);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

/* Feedback overlay */
.feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.feedback-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.feedback-content {
    background: white;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.feedback-overlay.show .feedback-content {
    transform: scale(1);
}

.feedback-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.feedback-text {
    font-size: 16px;
    font-weight: bold;
    color: #2d3436;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    max-width: 200px;
    text-align: center;
}

.tooltip.show {
    opacity: 1;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .game-header {
        padding: 6px 10px;
    }
    
    .stat-item {
        font-size: 12px;
    }
    
    .icon {
        font-size: 16px;
    }
    
    .action-buttons {
        gap: 6px;
        padding: 8px;
    }
    
    .hygiene-btn {
        padding: 10px 6px;
        font-size: 11px;
    }
    
    .btn-icon {
        font-size: 16px;
    }
    
    .chef-face {
        font-size: 36px;
    }
    
    .customer-face {
        font-size: 32px;
    }
}

/* Sparkle animation for clean surfaces */
@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}

.sparkle {
    position: absolute;
    color: #ffd700;
    font-size: 16px;
    animation: sparkle 1s ease-in-out;
    pointer-events: none;
}

/* Rush hour indicator */
.rush-hour {
    background: #e17055 !important;
    animation: rushPulse 1s infinite;
}

@keyframes rushPulse {
    0%, 100% { background: #e17055; }
    50% { background: #d63031; }
}